<template>
  <div>
    <TopBar title="设置" bgc="background: #F3F3F3;"></TopBar>
    <van-cell title="账号与安全" is-link to="/user/safe" />
    <van-cell @click="notify" style="margin-top: 1.5vh;" title="帮助与反馈" is-link />
    <van-cell @click="notify" title="联系我们" is-link />
    <van-cell @click="versionClick" title="版本号" is-link />
    <van-cell @click="notify" title="通用" is-link />
    <van-cell style=" text-align: center; margin-top: 1.5vh;" @click="logout" title="退出登录" />
    <van-dialog v-model="show" title="该功能暂未实现" confirmButtonText="确认" :before-close="beforeClose"></van-dialog>
    <van-dialog
      v-model="version"
      title="当前版本号为1.0.0版本"
      confirmButtonText="确认"
      :before-close="beforeClose"
    ></van-dialog>
  </div>
</template>

<script>
import TopBar from "@/views/component/topBar";
export default {
  components: {
    TopBar
  },
  data() {
    return {
      show: false,
      version: false
    };
  },
  methods: {
    versionClick() {
      this.version = true;
    },
    notify() {
      this.show = true;
    },
    beforeClose(action, done) {
      done();
    },
    logout() {
      // 清除token
      localStorage.removeItem("eleToken");
      this.$store.dispatch("clearCurrentState");

      // 页面跳转
      this.$router.push("/login");
    }
  }
};
</script>

<style>
</style>